diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-09-30 22:13:07 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-09-30 22:13:07 +0200 |
| commit | a725d4c7d28fee701b6997cc46cffddefbcd26bf (patch) | |
| tree | 1e0899dc9fa67f8c74d7e4b7023881959d571d4f /src/routes/projects/[id]/+page.server.ts | |
| parent | a17b24b8e95bf85a8522fc0c2cbbdb8da31bf018 (diff) | |
Allow granular routine frequencies like 5/2w
Diffstat (limited to 'src/routes/projects/[id]/+page.server.ts')
| -rw-r--r-- | src/routes/projects/[id]/+page.server.ts | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/routes/projects/[id]/+page.server.ts b/src/routes/projects/[id]/+page.server.ts index 3321bcd..83d7571 100644 --- a/src/routes/projects/[id]/+page.server.ts +++ b/src/routes/projects/[id]/+page.server.ts @@ -9,11 +9,8 @@ import { loadArchived, } from '$lib/server/services/routines'; import { completeRoutineAction } from '$lib/server/services/routine-actions'; -import { - numericId, - parseFormString, - parseFrequencyDays, -} from '$lib/server/services/validation'; +import { numericId, parseFormString } from '$lib/server/services/validation'; +import { Frequency } from '$lib/shared/frequency'; import type { Actions, PageServerLoad } from './$types'; export const load: PageServerLoad = async ({ params }) => { @@ -44,7 +41,7 @@ export const actions: Actions = { await add( numericId(params.id), name, - parseFrequencyDays(data.get('frequencyDays')), + Frequency.parse(data.get('frequency')?.toString() ?? '').toSpec(), ); } catch { return fail(400, { error: 'Fréquence invalide' }); |
